<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@ include file="../common/commonCssJs.jsp"%>
</head>
<body>

<div id="wapper">
	<header>
	<%@ include file="../common/layout/header.jsp"%>
	</header>
	
	<nav>
	<%@ include file="../common/layout/nav.jsp"%>
	</nav>
	
	<aside>
	<%@ include file="../common/layout/aside.jsp"%>
	</aside>
	
	<section>
		<form action="regiBoard">
		<input type="hidden" id="num" name="num" value="" />
			<table>
				<thead>
					<tr>
						<th>번호</th>
						<th>제목</th>
						<th>작성자</th>
						<th>날짜</th>
						<th>조회수</th>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${boardList}" var="board">
					<tr>
						<td>${board.no}</td>
						<td><a href="#none" onclick="javascript:goView('${board.num}');return false;" />${board.title}</a></td>
						<td>${board.regId}</td>
						<td>${board.regDate}</td>
						<td>${board.hitCnt}</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			
			<div>
			<ui:pagination paginationInfo = "${paginationInfo}" type="image" jsFunction="goPage"/>
			<input type="hidden" id="pageNo" name="pageNo" value="${paginationInfo.currentPageNo}" />
			</div>
			
			<input type="button" id="insert" value="입력" />
		
		</form>
	</section>
	
	<footer>
	<%@ include file="../common/layout/footer.jsp"%>
	</footer>
</div>

<script type="text/javascript">
	$("#insert").click(function() {
		$("form").submit();
	});
	
	function goView(num) {
		$("#num").val(num);
		$("form").attr("action", "boardView").submit();
	}
</script>
</body>
</html>